Field of the Invention
The invention relates in general to an embedded device and a memory management method of the embedded device, and more particularly to an embedded device capable of dynamically expanding a memory without reactivating the embedded device using a second level memory management unit (MMU) and a memory management method of the embedded device.
Description of the Related Art
FIG. 1 shows a functional block diagram of a conventional embedded device. The embedded device 100 includes a processing unit 110, a memory management unit (MMU) 115, a function module 120, a system memory 130 and a hardware memory 140. The embedded device 100 has limited hardware resources, and provides hardware devices of specific functions, e.g., devices including televisions, cell phones and multimedia players. A higher-end embedded device 100 usually carries an operating system to process more complication processes. The processing unit 110 utilizes the system memory 130 to operate the operating system. In general, the processing unit 110 accesses the system memory 130 through the built-in MMU 115. One main function of the MMU 115 is mapping virtual memory addresses (or referred to as logic addresses) that the operating system utilizes to physical memory addresses of the system memory 130, and features advantages of allowing the processing unit 110 to more efficiently utilize the system memory 130 and enhancing the security of the operating system. Operation principles of the MMU 115 are generally known to one person skilled in the art, and shall be omitted herein. The function module 120 of the embedded device 10 mainly provides the embedded device 100 with a predetermined function. For example, the function module 120 may be an image decoding circuit if the embedded device 100 is a television, or may be a radio-frequency (RF) transceiving circuit if the embedded device 100 is a cell phone. In general, the function module 120 requires a continuous block of physical memory for operations. After the operating system operates for a period of time, there is a great possibility that the unused memory space of the system memory 130 becomes fragmented. That is, an unused memory space with continuous physical memory addresses may not be obtained for the function module 120. Thus, the function module 120 usually has an exclusive hardware memory 140, which is independent from the system memory 130. When the function module 120 operates, the function of the function module 120 may be achieved through accessing the hardware memory 140. However, in a conventional embedded device 100, when the function module 120 completes its task and enters an idle state, the hardware memory 140 also enters an idle state, leading to a waste in hardware resources. For the embedded device 100 that values hardware resources, if the idle hardware memory 140 can be better employed without affecting the access of the hardware memory 140 when the function module 120 returns from the idle state to an operating state, the performance of the embedded device 100 can be further enhanced.